import { createStore } from "./redux";

/**
 * 处理器函数
 * @param {*} state 可以存储任意的内容
 * @param {*} action 动作对象，也是普通的js对象，必须有个type属性，用来表示你要干什么
 */
let reducer = (state = 0, action) => {
  switch (action.type) {
    case "ADD":
      return state + 1;
    case "Minus":
      return state - 1;
  }
};

let store = createStore(reducer);
